// 引入库 安装到vue中
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)

import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'

import cutomEn from './en'
import cutomZh from './zh'

// 创建实例
export default new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
    zh: {
      morning: '早安',
      goodDay: '祝你开心每一天',
      setLang: '恭喜设置语言成功',
      ...zhLocale,
      ...cutomZh

    },
    en: {
      morning: 'Good Morning',
      goodDay: 'have a good day',
      setLang: 'Congratulation, change language successfully',
      ...enLocale,
      ...cutomEn
    }
  }
})
